<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html class="app">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
        <title><?php echo C('WEB_SITE_TITLE');?></title>
        <script src="/management-system/Public/js/head.min.js" type="text/javascript"></script>
        <script src="/management-system/Public/js/jquery.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            head.load(
                    '/management-system/Public/css/common.css'
                    );
        </script>
    
</head>
<body class="">
    <section class="vbox">
        <header class="bg-dark dk header navbar navbar-fixed-top-xs">
            <div class="navbar-header aside-md">
                <a class="btn btn-link visible-xs" data-toggle="class:nav-off-screen,open" data-target="#nav,html">
                    <i class="fa fa-bars"></i>
                </a>
                <a href="#" class="navbar-brand" data-toggle="fullscreen"><img src="/management-system/Public/images/logo.png" class="m-r-sm"><?php echo C('WEB_SITE_TITLE');?></a>
                <a class="btn btn-link visible-xs" data-toggle="dropdown" data-target=".nav-user">
                    <i class="fa fa-cog"></i>
                </a>
            </div>
<!--            <ul class="nav navbar-nav hidden-xs">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle dker" data-toggle="dropdown">
                        <i class="fa fa-building-o"></i> 
                        <span class="font-bold">Activity</span>
                    </a>
                    <section class="dropdown-menu aside-xl on animated fadeInLeft no-borders lt">
                        <div class="wrapper lter m-t-n-xs">
                            <a href="#" class="thumb pull-left m-r">
                                <img src="/management-system/Public/images/avatar.jpg" class="img-circle">
                            </a>
                            <div class="clear">
                                <a href="#"><span class="text-white font-bold">@Mike Mcalidek</a></span>
                                <small class="block">Art Director</small>
                                <a href="#" class="btn btn-xs btn-success m-t-xs">Upgrade</a>
                            </div>
                        </div>
                        <div class="row m-l-none m-r-none m-b-n-xs text-center">
                            <div class="col-xs-4">
                                <div class="padder-v">
                                    <span class="m-b-xs h4 block text-white">245</span>
                                    <small class="text-muted">Followers</small>
                                </div>
                            </div>
                            <div class="col-xs-4 dk">
                                <div class="padder-v">
                                    <span class="m-b-xs h4 block text-white">55</span>
                                    <small class="text-muted">Likes</small>
                                </div>
                            </div>
                            <div class="col-xs-4">
                                <div class="padder-v">
                                    <span class="m-b-xs h4 block text-white">2,035</span>
                                    <small class="text-muted">Photos</small>
                                </div>
                            </div>
                        </div>
                    </section>
                </li>
                <li>
                    <div class="m-t m-l">
                        <a href="price.html" class="dropdown-toggle btn btn-xs btn-primary" title="Upgrade"><i class="fa fa-long-arrow-up"></i></a>
                    </div>
                </li>
            </ul>-->
            <ul class="nav navbar-nav navbar-right m-n hidden-xs nav-user">
                <li class="dropdown hidden-xs">
                    <a href="#" class="dropdown-toggle dker" data-toggle="dropdown"><i class="fa fa-fw fa-search"></i></a>
                    <section class="dropdown-menu aside-xl animated fadeInUp">
                        <section class="panel bg-white">
                            <form role="search">
                                <div class="form-group wrapper m-b-none">
                                    <div class="input-group">
                                        <input type="text" class="form-control" placeholder="Search">
                                        <span class="input-group-btn">
                                            <button type="submit" class="btn btn-info btn-icon"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>
                                </div>
                            </form>
                        </section>
                    </section>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        妳好，<?php echo session('user_auth.username');?> <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight">
                        <span class="arrow top"></span>
                        <li><a href="<?php echo U('User/updatePassword');?>" data-toggle="ajaxModal">修改密碼</a></li>
                        <li><a href="<?php echo U('User/updateNickname');?>" data-toggle="ajaxModal">修改昵稱</a></li>
                        <li class="divider"></li>
                        <li><a href="<?php echo U('Public/logout');?>">退出</a></li>
                    </ul>
                </li>
            </ul>      
        </header>
        <section>
            <section class="hbox stretch">
                <!-- .aside -->
                <aside class="bg-dark lter aside-md hidden-print hidden-xs" id="nav">          
                    <section class="vbox">
<!--                        <header class="header bg-primary lter text-center clearfix">
                            <div class="btn-group">
                                <button type="button" class="btn btn-sm btn-dark btn-icon" title="New project"><i class="fa fa-plus"></i></button>
                                <div class="btn-group hidden-nav-xs">
                                    <button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown">
                                        Switch Project
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu text-left">
                                        <li><a href="#">Project</a></li>
                                        <li><a href="#">Another Project</a></li>
                                        <li><a href="#">More Projects</a></li>
                                    </ul>
                                </div>
                            </div>
                        </header>-->
                        <section class="w-f scrollable">
                            <div class="slim-scroll" data-height="auto" data-disable-fade-out="true" data-distance="0" data-size="5px" data-color="#333333">

                                <!-- nav -->
                                <nav class="nav-primary hidden-xs">
                                    <ul class="nav">
                                        <?php if(is_array($__MENU__)): foreach($__MENU__ as $key=>$vo): ?><li<?php echo $__nav__['id']===$vo['id']?' class="active"':'' ?>>
                                            <a href="<?php echo (u($vo["url"])); ?>"<?php echo $__nav__['id']===$vo['id']?' class="active"':'' ?>>
                                                <i class="fa fa-dashboard icon">
                                                    <b class="bg-danger"></b>
                                                </i>
                                                <?php if(!empty($vo["child"])): ?><span class="pull-right">
                                                        <i class="fa fa-angle-down text"></i>
                                                        <i class="fa fa-angle-up text-active"></i>
                                                    </span><?php endif; ?>
                                                <span><?php echo ($vo["title"]); ?></span>
                                            </a>
                                            <?php if(!empty($vo["child"])): if($vo['id'] == 2): echo get_postmenu($vo['child']);?> 
                                                    <?php else: ?>
                                                    <ul class="nav lt">
                                                        <?php if(is_array($vo["child"])): foreach($vo["child"] as $k=>$vo2): ?><li<?php echo $__current__['group']===$k||($__current__['id']==$__nav__['id']&&empty($__current__['pid']))?' class="active"':'' ?>>
                                                            <a href="#" >                            
                                                                <i class="fa fa-angle-down text"></i>
                                                                <i class="fa fa-angle-up text-active"></i>
                                                                <span><?php echo ($k); ?></span>
                                                            </a>
                                                            <ul class="nav bg">
                                                                <?php if(is_array($vo2)): foreach($vo2 as $k2=>$vo3): ?><li<?php echo $__current__['id']===$vo3['id']?' class="active"':'' ?>>
                                                                    <a href="<?php echo (u($vo3["url"])); ?>" >
                                                                        <i class="fa fa-angle-right"></i>
                                                                        <span><?php echo ($vo3["title"]); ?></span>
                                                                    </a>
                                                                    </li><?php endforeach; endif; ?>
                                                            </ul>
                                                            </li><?php endforeach; endif; ?>
                                                    </ul><?php endif; endif; ?>
                                            </li><?php endforeach; endif; ?>
                                        <!-- 回收站 -->
                                        <li> <a href="<?php echo U('Article/recycle');?>" class="active"> 
                                       <i class="fa fa-trash-o icon"> <b class="bg-info"></b> </i> 
                                       <span>回收站</span> </a> 
                                        
                                      </li>
                           
                                    </ul>
                                </nav>
                                <!-- / nav -->
                            </div>
                        </section>

                        <footer class="footer lt hidden-xs b-t b-dark">
                            <div id="chat" class="dropup">
                                <section class="dropdown-menu on aside-md m-l-n">
                                    <section class="panel bg-white">
                                        <header class="panel-heading b-b b-light">Active chats</header>
                                        <div class="panel-body animated fadeInRight">
                                            <p class="text-sm">No active chats.</p>
                                            <p><a href="#" class="btn btn-sm btn-default">Start a chat</a></p>
                                        </div>
                                    </section>
                                </section>
                            </div>
                            <div id="invite" class="dropup">                
                                <section class="dropdown-menu on aside-md m-l-n">
                                    <section class="panel bg-white">
                                        <header class="panel-heading b-b b-light">
                                            John <i class="fa fa-circle text-success"></i>
                                        </header>
                                        <div class="panel-body animated fadeInRight">
                                            <p class="text-sm">No contacts in your lists.</p>
                                            <p><a href="#" class="btn btn-sm btn-facebook"><i class="fa fa-fw fa-facebook"></i> Invite from Facebook</a></p>
                                        </div>
                                    </section>
                                </section>
                            </div>
                            <a href="#nav" data-toggle="class:nav-xs" class="pull-right btn btn-sm btn-dark btn-icon">
                                <i class="fa fa-angle-left text"></i>
                                <i class="fa fa-angle-right text-active"></i>
                            </a>
<!--                            <div class="btn-group hidden-nav-xs">
                                <button type="button" title="Chats" class="btn btn-icon btn-sm btn-dark" data-toggle="dropdown" data-target="#chat"><i class="fa fa-comment-o"></i></button>
                                <button type="button" title="Contacts" class="btn btn-icon btn-sm btn-dark" data-toggle="dropdown" data-target="#invite"><i class="fa fa-facebook"></i></button>
                            </div>-->
                        </footer>
                    </section>
                </aside>
                <!-- /.aside -->
                <section id="content">
                    <section class="vbox">          
                        <section class="scrollable padder">
                            
	<div class="main-title cf">
		<h3>
			文檔排序 [ <a href="<?php echo (cookie('__forward__')); ?>">返回列表</a> ]
		</h3>
	</div>
	<div class="sort">
		<form action="<?php echo U('sort');?>" method="post">
<!-- 			<div class="sort_top">
				查找：<input type="text"><button class="btn search" type="button">查找</button>
			</div> -->
			<div class="sort_center row">
				<div class="sort_option col-sm-4 m-b-xs">
					<select value="" class="form-control" size="8">
						<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option class="ids" title="<?php echo ($vo["title"]); ?>" value="<?php echo ($vo["id"]); ?>"><?php echo ($vo["title"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
				</div>
				<div class="sort_btn col-sm-5 m-b-xs">
					<button class="top btn btn-primary" style="display: block; margin-bottom: 8px;" type="button">第 壹</button>
					<button class="up btn btn-primary" style="display: block; margin-bottom: 8px;" type="button">上 移</button>
					<button class="down btn btn-primary" style="display: block; margin-bottom: 8px;" type="button">下 移</button>
					<button class="bottom btn btn-primary" style="display: block; margin-bottom: 8px;" type="button">最 後</button>
				</div>
			</div>
			<div class="sort_bottom" style="margin-top: 10px;">
				<input type="hidden" name="ids">
				<button class="sort_confirm btn submit-btn btn-primary" type="button">確 定</button>
				<button class="sort_cancel btn btn-return" type="button" url="<?php echo (cookie('__forward__')); ?>">返 回</button>
			</div>
		</form>
	</div>

                        </section>
                    </section>
                    <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen, open" data-target="#nav,html"></a>
                </section>
                <aside class="bg-light lter b-l aside-md hide" id="notes">
                    <div class="wrapper">Notification</div>
                </aside>
            </section>
        </section>
    </section>
    <!--[if lt IE 9]>
    <script type="text/javascript">head.load('/management-system/Public/js/ie/html5shiv.js', '/management-system/Public/js/ie/respond.min.js','/management-system/Public/js/ie/excanvas.js');</script>
    <![endif]-->
    <script type="text/javascript">
        var server_error = "服務器端出錯", app_lang = '{_e APP_LANG}';
        head.load(
                '/management-system/Public/js/libs/spin.min.js',
                '/management-system/Public/js/libs/ladda.min.js',
                '/management-system/Public/js/jquery.query.js',
                '/management-system/Public/js/jquery.cookie.js',
                '/management-system/Public/js/libs/ladda.jquery.min.js',
                '/management-system/Public/js/bootstrap.js',
                '/management-system/Public/js/app.js',
                '/management-system/Public/js/sco.message.js',
               
                '/management-system/Public/js/common.js'
                );
    </script>
    <script type="text/javascript">
        (function () {
            var ThinkPHP = window.Think = {
                "ROOT": "/management-system", //當前網站地址
                "APP": "/management-system/index.php?s=", //當前項目地址
                "PUBLIC": "/management-system/Public", //項目公共目錄地址
                "DEEP": "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
                "MODEL": ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
                "VAR": ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
            }
        })();
    </script>
    <script type="text/javascript" src="/management-system/Public/static/think.js"></script>

	<script type="text/javascript">
		$(function(){
			sort();
			$(".top").click(function(){
				rest();
				$("option:selected").prependTo("select");
				sort();
			})
			$(".bottom").click(function(){
				rest();
				$("option:selected").appendTo("select");
				sort();
			})
			$(".up").click(function(){
				rest();
				$("option:selected").after($("option:selected").prev());
				sort();
			})
			$(".down").click(function(){
				rest();
				$("option:selected").before($("option:selected").next());
				sort();
			})
			$(".search").click(function(){
				var v = $("input").val();
				$("option:contains("+v+")").attr('selected','selected');
			})
			function sort(){
				$('option').text(function(){return ($(this).index()+1)+'.'+$(this).text()});
			}

			//重置所有option文字。
			function rest(){
				$('option').text(function(){
					return $(this).text().split('.')[1]
				});
			}

			//獲取排序並提交
			$('.sort_confirm').click(function(){
				var arr = new Array();
				$('.ids').each(function(){
					arr.push($(this).val());
				});
				$('input[name=ids]').val(arr.join(','));
				$.post(
					$('form').attr('action'),
					{
					'ids' :  arr.join(',')
					},
					function(data){
						if (data.status) {
	                        updateAlert(data.info + ' 頁面即將自動跳轉~','alert-success');
	                    }else{
	                        updateAlert(data.info,'alert-success');
	                    }
	                    setTimeout(function(){
	                        if (data.status) {
	                        	$('.sort_cancel').click();
	                        }
	                    },1500);
					},
					'json'
				);
			});

			//點擊取消按鈕
			$('.sort_cancel').click(function(){
				window.location.href = $(this).attr('url');
			});
		})
	</script>

</body>
</html>